<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
	<!--<![endif]-->

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>商户登录</title>
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
		<meta content="telephone=no" name="format-detection" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<!-- 引入样式 -->
		<link rel="stylesheet" type="text/css" href="../styles/vant.css" />
		<link rel="stylesheet" href="../styles/common.css" />
		<link rel="stylesheet" href="../styles/vant.css">
		<link rel="stylesheet" href="../styles/common.css" />
		<link rel="stylesheet" href="../styles/global.css" />
		<link rel="stylesheet" href="../styles/login.css" />
		<link rel="stylesheet" href="../styles/font.css">

		<style type="text/css">
			#qrcodeCanvas canvas {
				width: 60%;
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
			}
			.my_code{
				width: 100%;
				text-align: center;
				padding-top: 1.3rem;				
				font-size: 0.48rem;
				line-height: 1.2rem;
			}
		</style>
	</head>
	<body>
		<div class="container" id="app">
			<div class="header">
				<div onclick="go_back()"><span><i  class="iconfont icon-back"></i></span></div>
				<div></div>
				<div class="headericon"></div>
			</div>
			<div class="my_code" >
				
			</div>
			
			<div style="padding-top: 0.8rem;" id="qrcodeCanvas"></div>
		</div>
	</body>

</html>
<script src="../scripts/rem.js"></script>
<script src="../scripts/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/utf.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/qrcode.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../scripts/vant.js"></script>
<script type="text/javascript">
	$(function() {
		var admin = localStorage.getItem("admin") ? JSON.parse(localStorage.getItem("admin")) : '';
		console.log(admin)
		
		if (!admin) {
			window.location.href = '../login.html'
			return
		}
		$(".my_code").html(admin.cname+'的二维码')
		var data = {
			mid: admin.mid,
			cname: admin.cname,
		}
		$("#qrcodeCanvas").qrcode({
			render: "canvas", //设置渲染方式，有table和canvas，使用canvas方式渲染性能相对来说比较好
			text: JSON.stringify(data), //扫描二维码后显示的内容,可以直接填一个网址，扫描二维码后自动跳向该链接
			//二维码的高度
			background: "#ffffff", //二维码的后景色
			foreground: "#000000", //二维码的前景色
			//二维码中间的图片
		});
	})


	function go_back() {
		window.history.back(-1);
	}
</script>
